﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Control="clr-namespace:AMing.Control;assembly=AMing.Control" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        mc:Ignorable="d" x:Class="MusicPlayerPlus.PlugIn.MainWindows.MainWindow"
        xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
        xmlns:il="clr-namespace:Microsoft.Expression.Interactivity.Layout;assembly=Microsoft.Expression.Interactions"
        Title="MainWindow" Height="600" Width="600"
    Closed="Window_Closed_1" AllowsTransparency="True" WindowStyle="None" Background="{x:Null}">
	<Window.Resources>
		<DataTemplate x:Key="DataTemplate1">
            <Grid Margin="0,2" Background="{Binding BackGroundBrush}">
                <TextBlock Margin="52,0,0,1" TextWrapping="Wrap" Text="{Binding AlbumName}" d:LayoutOverrides="Width, Height" VerticalAlignment="Bottom"/>
                <Image Width="50" Height="50" Source="{Binding Cove}" HorizontalAlignment="Left"/>
                <TextBlock Margin="52,0,0,0" TextWrapping="Wrap" Text="{Binding Name}" VerticalAlignment="Top" d:LayoutOverrides="Width" FontSize="18.667"/>
			</Grid>
		</DataTemplate>

        <ItemsPanelTemplate x:Key="ItemsPanelTemplate">
            <WrapPanel IsItemsHost="True" Orientation="Vertical" >
                <i:Interaction.Behaviors>
                    <il:FluidMoveBehavior AppliesTo="Children" Duration="0:0:0.5"/>
                </i:Interaction.Behaviors>
            </WrapPanel>
        </ItemsPanelTemplate>
        <Style x:Key="ListBoxStyle1" TargetType="{x:Type ListBox}">
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
            <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
            <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ListBox}">
                        <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="1" SnapsToDevicePixels="true">
                            <ScrollViewer Focusable="false" Padding="{TemplateBinding Padding}">
                                <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                                    <i:Interaction.Behaviors>
                                        <il:FluidMoveBehavior Duration="0:0:0.3"/>
                                    </i:Interaction.Behaviors>
                                </ItemsPresenter>
                            </ScrollViewer>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
                            </Trigger>
                            <Trigger Property="IsGrouping" Value="true">
                                <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>
    <Grid>
		<Border BorderBrush="#FF41C3C6" BorderThickness="2">
			<Grid MouseLeftButtonDown="menu_main_MouseLeftButtonDown_1">
				<Grid>
					<Image x:Name="img_cove" Stretch="Fill" Width="{Binding Height, ElementName=img_cove}" HorizontalAlignment="Center"/>
				</Grid>

				<Menu x:Name="menu_main" Height="20" VerticalAlignment="Top" Background="#66F0F0F0" >
					<MenuItem x:Name="menu_temp" Header="插件" Background="{x:Null}" Foreground="#FF41C3C6"/>
					<MenuItem Header="Mini" Foreground="#FF41C3C6" Click="MenuItem_Click_1"/>
					<MenuItem Header="Close" Foreground="#FF41C3C6" Click="MenuItem_Click_2"/>
				</Menu>
				<TextBlock x:Name="txt_info" Text="MuisicPlayerPlus" TextTrimming="WordEllipsis" Foreground="#FF41C3C6" Margin="140,2,10,0" VerticalAlignment="Top"/>
				<StackPanel x:Name="sp_btns" 
					HorizontalAlignment="Left" Margin="0,20,0,20" Width="100"
					Visibility="Collapsed"/>
				<ListBox x:Name="listbox_playlist" 
					Margin="10,25,0,55" HorizontalAlignment="Left" Width="90" 
					MouseDoubleClick="listbox_playlist_MouseDoubleClick_1" Background="#66FFFFFF" Foreground="#FF41C3C6" BorderBrush="#FF41C3C6" BorderThickness="2"/>
				<ListBox x:Name="listbox" 
					Margin="105,25,10,55" 
					MouseDoubleClick="listbox_MouseDoubleClick_1" ItemTemplate="{DynamicResource DataTemplate1}" Style="{DynamicResource ListBoxStyle1}" ItemsPanel="{DynamicResource ItemsPanelTemplate}" Background="#66FFFFFF" Foreground="#FF41C3C6" BorderBrush="#FF41C3C6" BorderThickness="2"/>
				<Grid Height="70" VerticalAlignment="Bottom">
					<Rectangle Fill="#66F4F4F5" Margin="0,20,0,0"/>

					<StackPanel Margin="10.5,25,0,20" Width="320" Orientation="Horizontal" HorizontalAlignment="Left">
						<Button x:Name="btn_pre" Margin="1,0" Width="50" Click="btn_pre_Click_1" Content="上一首" Background="#66DDDDDD" Foreground="#FF41C3C6"/>
						<Button x:Name="btn_play" Margin="1,0" Width="50" Click="btn_play_Click_1" Content="播放" Background="#66DDDDDD" Foreground="#FF41C3C6"/>
						<Button x:Name="btn_stop" Margin="1,0" Width="50" Click="btn_stop_Click_1" Content="停止" Background="#66DDDDDD" Foreground="#FF41C3C6"/>
						<Button x:Name="btn_next" Margin="1,0" Width="50" Click="btn_next_Click_1" Content="下一首" Background="#66DDDDDD" Foreground="#FF41C3C6"/>
						<ComboBox x:Name="cb_order" Margin="1,0" Width="110" SelectionChanged="cb_order_SelectionChanged_1" Opacity="0.4" Foreground="#FF41C3C6"/>
					</StackPanel>
					<Control:Slider_TimeLine x:Name="vol" Margin="331.834,0,10,20"
						ChangeValue="vol_ChangeValue_1"
						Max="1" Value="1" Opacity="0.5"/>
					<Control:Slider_TimeLine x:Name="timeline"
						Margin="0,20,0,0"
						ChangeValue="timeline_ChangeValue_1" Opacity="0.5" />

				</Grid>

			</Grid>
		</Border>
	</Grid>
</Window>
